export function countTime(endDateStr,showStr) {
  // https://www.cnblogs.com/maqingyuan/p/8452012.html
      //获取当前时间
      let date = new Date();
      let now = date.getTime();
      //设置截止时间
      // let str="2020/8/30 00:00:00";
      let endDate = new Date(endDateStr);
      let end = endDate.getTime();

      //时间差
      let leftTime = end-now;
      //定义变量 h,m,s保存倒计时的时间
      let d,h,m,s;
      if (leftTime>=0) {
          d = Math.floor(leftTime/1000/60/60/24);
          h = Math.floor(leftTime/1000/60/60%24);
          m = Math.floor(leftTime/1000/60%60);
          s = Math.floor(leftTime/1000%60);
      }
      //将0-9的数字前面加上0，例1变为01
      d = checkTime(d);
      h = checkTime(h);
      m = checkTime(m);
      s = checkTime(s);
      showStr = d+ '天' + h +":" + m +":" + s;
      //递归每秒调用countTime方法，显示动态时间效果
      setTimeout(countTime,1000);
      // return showStr
}
function checkTime(i){
  if (i<10) {
    i = "0"+i;
  }
  return i;
}
